package pl.edu.mimuw.irs.core.util;

public class NamingTool {

	// *** Attributes

	// *** Methods
	
	public static String abbreviation(String string) {
		String[] words = string.split(" ");
		StringBuffer noSpaces = new StringBuffer();
		StringBuffer abbreviation = new StringBuffer();
		for (String word : words) {
			if (word.length() > 0) {
				String newWord = Character.toUpperCase(word.charAt(0)) + word.substring(1);
				noSpaces.append(newWord);
			}
		}
		for (char character : noSpaces.toString().toCharArray()) {
			if (Character.isUpperCase(character) ||
					!Character.isLetter(character)) abbreviation.append(character);
		}
		return abbreviation.toString();
	}
	
}
